<template>
  <ele-modal
    form
    width="95%"
    :model-value="modelValue"
    :title="title"
    @update:modelValue="updateModelValue"
  >
    <bouns :default-where="where" />
  </ele-modal>
</template>

<script setup>
  import { ref, watch } from 'vue';
  import Bouns from '@/views/report/bouns/components/list.vue';

  const emit = defineEmits(['done', 'update:modelValue']);
  const props = defineProps({
    /** 弹窗是否打开 */
    modelValue: Boolean,
    /** 修改回显的数据 */
    data: Object,
    type: String
  });

  /** 请求状态 */
  const title = ref('');
  const where = ref({});

  /** 更新modelValue */
  const updateModelValue = (value) => {
    emit('update:modelValue', value);
  };

  watch(
    () => props.modelValue,
    (modelValue) => {
      if (modelValue) {
        title.value = props.data.report_date + '的推荐奖励列表';
        where.value.create_time_s = props.data.report_date;
        where.value.create_time_e = props.data.report_date;
        where.value.status = 99;
        console.log(where.value, 'wtgff');
      } else {
        console.log('什么也没发生');
      }
    }
  );
</script>

<style lang="scss" scoped>
  .detail-table :deep(.el-descriptions__label) {
    width: 108px;
    text-align: right;
    font-weight: normal;
  }
</style>
